/*
 * @Author: 李环玉 834654733@qq.com
 * @Date: 2023-12-21 22:22:51
 * @LastEditors: 李环玉 834654733@qq.com
 * @LastEditTime: 2023-12-23 16:10:56
 * @FilePath: \vue3-ts-vite\src\api\login.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

// 登录方法
export function login(data: any) {
  sessionStorage.removeItem('systemName')
  return request({
    url: '/user/admin/login',
    method: 'POST',
    data
  })
}

// 获取当前登录用户所有按钮权限
export const getPermBtm = (params:any) => {
  return request({
    url: '/button',
    method: 'get',
    params
  })
}

// 获取用户详细信息
export function getUserInfo(params:any) {
  return request({
    url: `/user/admin`,
    method: 'get',
  })
}

// 退出方法
export function logout() {
  return request({
    url: '/portal-sso/web/logout',
    method: 'post'
  })
}
//上传用户头像
export function uploadAvatar(params:any) {
  return request({
    url: '/upload',
    method: 'post',
    data:params,
    type:'file'
  })
}
//修改用户
export const editAdmin = (params:any) => {
  return request({
    url: '/user/admin/update',
    method: 'post',
    data:params
  })
}
